Hi Peter,
I can't think of a simple solution.
We might gray out/disable the Spindle "off" button while GCode is running. But I wonder if some User might want to be able to turn on/off the "spindle" while the Job is running for whatever reason.
Another option would be to pass as a parameter for the M5 Action whether the Action was initiated from a button or GCode. The C Program could then decide based on that whether it wants to perform the action or not.
The M5 action currently just places a 5 into the Var parameter like all other Actions that don't have an associated parameter. We might set it to 1000005 if initiated from a button.
Does this seem like a good solution?
Regards
TK